package org.aphelie.torg.ruler.core.character;

import org.eclipse.core.runtime.CoreException;
import org.aphelie.torg.ruler.core.IIdentifiable;

/**
 * A model object that represents a character
 * 
 * @noimplement This interface is not intended to be implemented by clients.
 * @noextend This interface is not intended to be extended by clients.
 */
public interface ICharacterBase extends IExtensions, IIdentifiable {

    String K_PLAYER = "player"; //$NON-NLS-1$
    String getPlayer();
    void setPlayer(String value) throws CoreException;
    
    String K_CHRONICLE = "chronicle"; //$NON-NLS-1$
    String getChronicle();
    void setChronicle(String value) throws CoreException;
    
    String K_STRAIN = "strain"; //$NON-NLS-1$
    String getStrain();
    void setStrain(String value) throws CoreException;
    
    String K_PROVIDER = "provider-name"; //$NON-NLS-1$
    String getProviderName();
    void setProviderName(String providerName) throws CoreException;

    String P_VERSION = "version"; //$NON-NLS-1$
    String getVersion();
    void setVersion(String version) throws CoreException;
    
    ICharacterSketch getSketch();
    
    
    ICharacterLibrary[] getLibraries();

    /**
     * A property that will be used to notify
     * that library order in a plug-in has changed. 
     */
    String P_LIBRARY_ORDER = "library_order"; //$NON-NLS-1$

    /**
     * A property that will be used to notify
     * that import order in a plug-in has changed. 
     */
    String P_IMPORT_ORDER = "import_order"; //$NON-NLS-1$

    /**
     * A property that will be used to notify
     * that 3.0 release compatibility flag has been changed. 
     */
    String P_SCHEMA_VERSION = "schema-version"; //$NON-NLS-1$

    /**
     * Adds a new library to this plugin.
     * This method will throw a CoreException if
     * model is not editable.
     *
     * @param library the new library
     */
    void add(ICharacterLibrary library) throws CoreException;

    /**
     * Adds a new plug-in import to this plugin.
     * This method will throw a CoreException if
     * model is not editable.
     *
     * @param characterImport the new import object
     */
    /*
    void add(ICharacterImport characterImport) throws CoreException;
    */

    /**
     * Removes an import from the plugin. This
     * method will throw a CoreException if
     * the model is not editable.
     *
     * @param characterImport the import object
     */
    /*
    void remove(ICharacterImport characterImport) throws CoreException;
    */

    /**
     * Returns libraries referenced in this plug-in.
     *
     * @return an array of libraries
     */
    

    /**
     * Returns imports defined in this plug-in.
     *
     * @return an array of import objects
     */
    /*
    ICharacterImport[] getImports();
    */

    /**
     * Returns this plug-in's version
     * @return the version of the plug-in
     */


    /**
     * Removes a library from the plugin. This
     * method will throw a CoreException if
     * the model is not editable.
     *
     * @param library the library object
     */
    void remove(ICharacterLibrary library) throws CoreException;

    /**
     * Sets the version of the plug-in.
     * This method will throw a CoreException
     * if the model is not editable.
     *
     * @param version the new plug-in version
     */


    /**
     * Swaps the positions of the provided libraries
     * in the list of libraries. Libraries are looked up
     * by the class loader in the order of declaration.
     * If two libraries contain classes with the same
     * name, library order will determine which one is
     * encountered first.
     *
     * @param l1 the first library object
     * @param l2 the second library object
     */
    void swap(ICharacterLibrary l1, ICharacterLibrary l2) throws CoreException;

    /**
     * Swaps the positions of the plug-ins provided in
     * in the dependency list. This order is the one used
     * used by the classloader when loading classes.
     *
     * @param import1 the first import object
     * @param import2 the second import object
     */
    /*
    void swap(ICharacterImport import1, ICharacterImport import2) throws CoreException;
    */

    /**
     * Returns version of the manifest grammar
     * @return version of the manifest grammar, or <samp>null</samp>
     */
    String getSchemaVersion();

    /**
     * Sets the R3.0 compatibility flag
     * @param schemaVersion version of the manifest grammar
     */
    void setSchemaVersion(String schemaVersion) throws CoreException;

}
